package org.example.juc;

/**
 * Java中ReentrantLock和synchronized 都是可重入锁
 * @author 张琪
 * @date 2024/4/23 15:27
 */
public class Widget {

    public synchronized void doSomething() {
        System.out.println("Widget doSomething");
        doOthers();
    }

    public synchronized void doOthers() {
        System.out.println("Widget doOthers");
    }

}
